package spring.beanTest.interfaceTest;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-beanTest-interfaceTest.xml");
        //此时必须要获取Spring管理的实例，因为现在scope="prototype" 只有请求获取的时候才会实例化对象
        for(String s: context.getBeanDefinitionNames())
        System.out.println(s);
        ((ServiceImpl1)context.getBean("serviceImpl1")).test();
    }
}
